using Admin2024.Domain.Entity.System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Admin2024.EntityFrameworkCore.EntityConfiguration;

public class AppPermissionConfiguration : BaseEntityConfiguration<AppPermission>
{
    public override void Configure(EntityTypeBuilder<AppPermission> builder)
    {
        base.Configure(builder);

        // 表名
        builder.ToTable("app_permission");

        // 每个实体只需要配置自有属性即可，数据库列顺序从3开始
        builder.Property(p => p.AppResourceId)
        .HasColumnName("app_resource_id")
        .HasComment("资源Id")
        .HasColumnOrder(3);

        builder.Property(p => p.AppOperationId)
        .HasColumnName("app_operation_id")
        .HasComment("操作Id")
        .HasColumnOrder(4);

    }
}